<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/11/23
  Time: 9:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>考试题集管理</title>
    <base href="${pageContext.request.scheme }://${pageContext.request.serverName }:${pageContext.request.serverPort }${pageContext.request.contextPath }/ "/>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <!-- Bootstrap -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="https://cdn.jsdelivr.cn/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
</head>
<body>
    <form action="quetion.do" method="get">
        <input type="hidden" name="m" value="search">
        <input type="text" placeholder="请输入要搜索的姓名" name="content">
        <input type="submit" value="搜索">
    </form>
    <a href="addQuetion.jsp">添加考试题集</a>
    <table width="600px" border="1px" class="table table-condensed table-bordered table-hover table-striped">
        <tr>
            <th>ID</th>
            <th>内容</th>
            <th>答案</th>
            <th>选项A</th>
            <th>选项B</th>
            <th>选项C</th>
            <th>选项D</th>
            <th>难度</th>
            <th>考试题集</th>
            <th>图片</th>
            <th>操作</th>
        </tr>
        <c:forEach var="quetion" items="${page.data}">
            <tr>
                <td>${quetion.content}</td>
                <td>${quetion.answer}</td>
                <td>${quetion.optionA}</td>
                <td>${quetion.optionB}</td>
                <td>${quetion.optionC}</td>
                <td>${quetion.optionD}</td>
                <td>${quetion.difficulty}</td>
                <td>${quetion.quetionSetName}</td>
                <td><img style="width: 30px;height: 30px" src="/images/${quetion.image}"></td>
                <td>
                    <a href="quetion.do?m=findById&id=${quetion.id}">更新</a>
                    <a href="javascript:if(confirm('是否确认删除？'))location.href='quetion.do?m=deleteById&id=${quetion.id}'">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
    <nav aria-label="Page navigation">
        <ul class="pagination">
            <c:choose>
                <c:when test="${page.current > 1}">
                    <li>
                        <a href="quetion.do?m=findPage&current=${page.current-1}" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                </c:when>
                <c:otherwise>
                    <li class="disabled">
                        <a aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                </c:otherwise>
            </c:choose>
            <c:forEach var="i" begin="1" end="${page.pageCount}" step="1">
                <li class="${page.current==i?'active':''}"><a href="quetion.do?m=findPage&current=${i}">${i}</a></li>
            </c:forEach>
            <c:choose>
                <c:when test="${page.current < page.pageCount}">
                    <li>
                        <a href="quetion.do?m=findPage&current=${page.current+1}" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </c:when>
                <c:otherwise>
                    <li class="disabled">
                        <a  aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </c:otherwise>
            </c:choose>
        </ul>
    </nav>

</body>
</html>
